﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SmartEP.Presenter;
using SmartEP.DTO;

namespace SmartDesktop
{
    public partial class BaseStep : UserControl, IBaseStep
    {
        private GroupStepType _groupStep;

        protected Patient patient;
        protected int step;
        protected PatientCarePresenter presenter;

        protected enum GroupStepType
        {
            PrivacyPolicyAndConsent = 1,
            PatientInformation,
            MedicalHistory,
            Completed
        }

        protected GroupStepType GroupStep
        {
            get
            {
                return _groupStep;
            }
            set
            {
                _groupStep = value;

                lblPrivacyPolicyAndConsent.ForeColor = Color.Gray;
                lblPatientInformation.ForeColor = Color.Gray;
                lblMedicalHistory.ForeColor = Color.Gray;

                switch (_groupStep)
                {
                    case GroupStepType.PrivacyPolicyAndConsent:
                        lblPrivacyPolicyAndConsent.ForeColor = Color.Black;
                        break;
                    case GroupStepType.PatientInformation:
                        lblPatientInformation.ForeColor = Color.Black;
                        break;
                    case GroupStepType.MedicalHistory:
                        lblMedicalHistory.ForeColor = Color.Black;
                        break;
                }
            }
        }

        public int Step 
        {
            get
            {
                return this.step;
            }
        }
        public Patient CurrentPatient
        {
            get
            {
                return patient;
            }
        }
        public BaseStep()
        {
            InitializeComponent();
        }
        public BaseStep(PatientCarePresenter presenter)
        {
            InitializeComponent();
            this.presenter = presenter;
            this.presenter.CurrentView = this;
        }

        private void btnEndPatientSession_Click(object sender, EventArgs e)
        {
            this.presenter.EndPatientSession();
        }

        private void btnLogout_Click(object sender, EventArgs e)
        {
            this.presenter.Logout();
        }
    }
}
